package com.kexun.common.utils;

public class ResponseEntity {


    private int code = 0;

    private String message = "";

    private Object data = null;


    public ResponseEntity success() {
        this.code = 0;
        this.message = "success";
        return this;
    }

    public ResponseEntity success(String message) {
        this.code = 0;
        this.message = message;
        return this;
    }

    public ResponseEntity error(String message) {
        this.code = -1;
        this.message = message;
        return this;
    }

    public ResponseEntity success(String message, Object data) {
        this.code = 0;
        this.message = message;
        this.data = data;
        return this;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
